import Vue from 'vue'
import Router from 'vue-router'

import markdown from '@/components/demo/markdown'

import login from '@/components/pages/login'
import tree_main from '@/components/pages/main/tree'
import top_tree from '@/components/pages/main/top_tree'
import tree_static from '@/components/pages/main/tree_static'

import general_index from '@/components/pages/index/general_index'

import user_list from '@/components/pages/system/user_list'
import role_list from '@/components/pages/system/role_list'
import right_list from '@/components/pages/system/right_list'

import log_login from '@/components/pages/log/log_login'
import log_system from '@/components/pages/log/log_system'
import log_newest from '@/components/pages/log/log_newest'

import demo from '@/components/demo/parent'

Vue.use(Router)

//路由配置
const routes = [
  {
    path: '/demo/markdown',
    name: 'markdown',
    component: markdown
  },
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'login',
    component: login
    // component: demo
  },
  {
    path: '/main',
    name: 'main',
    // component: tree_main,
    component: top_tree,
    // component: tree_static,
    children: [
      //系统首页
      {
        path: '/index',
        name: 'index',
        component: general_index
      },
      //用户列表
      {
        path: '/system/userList',
        name: 'userList',
        component: user_list
      },
      //角色列表
      {
        path: '/system/roleList',
        name: 'roleList',
        component: role_list
      },
      //权限列表
      {
        path: '/system/rightList',
        name: 'rightList',
        component: right_list
      },
      //登陆日志
      {
        path: '/log/login',
        name: 'logLogin',
        component: log_login
      },
      //系统日志
      {
        path: '/log/system',
        name: 'logSystem',
        component: log_system
      },
      //日志监控
      {
        path: '/log/newest',
        name: 'logNewest',
        component: log_newest
      }
    ]
  }

]

var router = new Router({
  mode: 'hash',
  routes: routes
})

export default router
